package codes

//go:generate go run gen.go -output codes.go

// ValidateManagementCode 校验注册管理机构编码
func ValidateManagementCode(b []byte, s string) bool {
	if len(b) != 18 {
		return false
	}
	name, ok := ManagementCodes[b[0]]
	if !ok {
		return false
	}
	return name == s
}

// ValidateOrganizationTypeCode 校验组织机构代码类别
func ValidateOrganizationTypeCode(b []byte, s string) bool {
	if len(b) != 18 {
		return false
	}
	name, ok := OrganizationTypeCodes[string(b[:2])]
	if !ok {
		return false
	}
	return name == s
}
